/*
 * PyMultiphase.cpp
 *
 *  Created on: 12 Mar 2012
 *      Author: allan
 */

#include "PyMultiphase.h"

// GeoReact includes
#include <GeoReact.h>

// Boost includes
#include <boost/python.hpp>
using namespace boost::python;

void export_Multiphase()
{
	const std::vector<ChemicalSpecies>& (Multiphase::*GetAllChemicalSpecies)() const = 
		&Multiphase::GetChemicalSpecies;
	
	class_<Multiphase>("Multiphase", init<>())
		.def(init<const Multiphase&>())
		.def(init<const std::vector<Phase>&>())
		
		.add_property("num_phases",
			make_function(&Multiphase::GetNumPhases))
		
		.add_property("num_species",
			make_function(&Multiphase::GetNumSpecies))			
		
		.add_property("num_elements",
			make_function(&Multiphase::GetNumElements))
		
		.add_property("phases",
			make_function(&Multiphase::GetPhases,
				return_internal_reference<>()))
		
		.add_property("chemical_species",
			make_function(GetAllChemicalSpecies,
				return_internal_reference<>()))
		
		.add_property("species",
			make_function(&Multiphase::GetSpecies,
				return_internal_reference<>()))
		
		.add_property("elements",
			make_function(&Multiphase::GetElements,
				return_internal_reference<>()))
		
		.add_property("elemental_composition_matrix",
			make_function(&Multiphase::GetElementalCompositionMatrix,
				return_internal_reference<>()))
				
		.add_property("species_phase_map",
			make_function(&Multiphase::GetSpeciesPhaseMap,
				return_internal_reference<>()))
		
		.add_property("phase_species_map",
			make_function(&Multiphase::GetPhaseSpeciesMap,
				return_internal_reference<>()))
		
		.add_property("species_element_map",
			make_function(&Multiphase::GetSpeciesElementMap,
				return_internal_reference<>()))
		
		.add_property("element_species_map",
			make_function(&Multiphase::GetElementSpeciesMap,
				return_internal_reference<>()))
		
		.def("SpeciesIndex",
			&Multiphase::SpeciesIndex)
		
		.def("SpeciesIndices",
			&Multiphase::SpeciesIndices)
		
		.def("PhaseIndex",
			&Multiphase::PhaseIndex)
		
		.def("TotalMolesPhases",
			&Multiphase::TotalMolesPhases)
			
		.def("PhaseComposition",
			&Multiphase::PhaseComposition)
			
		.def("MolarFractions",
			&Multiphase::MolarFractions)
		
		.def("ActivityCoefficients",
			&Multiphase::ActivityCoefficients)
			
		.def("Activities",
			&Multiphase::Activities)
		
		.def("ActivityDerivatives",
			&Multiphase::ActivityDerivatives);
}
